<p>
    <?= $this->App->buttonLink('+ Nova Uplata', '/payments/create') ?>
    <?= $this->Html->link('Kampanje', '/campaigns') ?> |
    <?= $this->Html->link('Fakture', '/invoices') ?>
</p>
<?= $this->element('entity_table', array(
    'columns' => array(
        'Id'            => 'Payment.id',
        'Kampanja'      => 'Campaign.label',
        'Faktura'       => 'Invoice.number',
        'Datum'         => array('Payment.date', function($row) {
            return date_local($row['Payment']['date']); 
        }),
        'Iznos'  => array('Payment.amount', function($row) {
            return currency_format($row['Payment']['amount']);
        })
    ),
    'columnWidth' => array(
        'Id'            => '1%',
        'Kampanja'      => '30%',
        'Faktura'       => '10%',
        'Datum'         => '10%',
        'Iznos'  => '10%'
    ),
    'links' => array(
        'Id'       => array('/payments/edit/%d', 'Payment.id'),
        'Kampanja' => array('/campaigns/edit/%d', 'Campaign.id'),
        'Faktura'  => array('/invoices/edit/%d', 'Invoice.id')
    ),
    'filter' => array(
        'Datum' => ''.@$filter['Payment']['date'],
        'Iznos' => ''.@$filter['Payment']['amount']
    ),
    'data'     => $payments,
    'id'       => 'Payment.id',
    'entity'   => 'payments',
    'sort_by'  => $sort_by,
    'sort_dir' => $sort_dir
)) ?>
